package com.sgb.kjwl.view.ui.activity.self.authentication

import android.content.Context
import android.content.Intent
import android.text.TextUtils
import androidx.databinding.DataBindingUtil
import com.sgb.kjwl.AppActivity
import com.sgb.kjwl.R
import com.sgb.kjwl.databinding.ActivityOrganizationPostSuccessBinding
import com.sgb.kjwl.view.event.self.OrganizationAuthEvent
import com.swgk.core.event.EventConstant
import org.greenrobot.eventbus.EventBus

class OrganizationPostSuccess : AppActivity() {

    private lateinit var mBinding : ActivityOrganizationPostSuccessBinding
    private var from : String?=""
    companion object {
        fun launch(context: Context?) {
            val intent = Intent(context, OrganizationPostSuccess::class.java)
            context!!.startActivity(intent)
        }
    }

    override fun initView() {
        super.initView()
        if (intent!=null){
            from =intent.getStringExtra("from")
        }
        mBinding = DataBindingUtil.setContentView(this, R.layout.activity_organization_post_success)
        mBinding.include.ivBack.setOnClickListener { finish() }
        mBinding.include.titleView.text = "认证结果"
        if (!TextUtils.isEmpty(from)) {
           mBinding.detail.text="您的申请将在1-3个工作日审核完毕！";
        }
        mBinding.tvEnsure.setOnClickListener {
            if (TextUtils.isEmpty(from)){
                EventBus.getDefault().post(OrganizationAuthEvent.make(EventConstant.EVENT_ORGANIZATION_AUTH_SUCCESS))
            }
            finish()
        }
    }


}